# 将数据库读出的数据变为能被神经网络识别的数据
from src.go import Go

import src.constant as constant
import torch.nn as nn
import torch
from torch.utils.data import TensorDataset
from torch.utils.data import Dataset

DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# 棋盘大小 默认19，暂时没打算考虑其他大小
GOBAN_SIZE = 19


class MyDataSet(Dataset):
    def __init__(self, datas):
        super(MyDataSet, self).__init__()
        self.datas = datas

    def __len__(self):
        return len(self.datas)

    # 尽可能简单，collect会处理
    def __getitem__(self, item):
        single = self.datas[item]
        return single
